package com.health.tools;

import android.os.Environment;

import java.io.File;


/**
 * author : xiaoxin
 * date   : 2020/3/19 19:16
 * desc   :
 * update :
 */
public class FileUtils {

    public static final String PATH_ROOT =
            Environment.getExternalStorageDirectory().getAbsolutePath() + "/report/";

    public static final String VIDEO_PATH_ROOT =
            Environment.getExternalStorageDirectory().getAbsolutePath() + "/healthvideo/";
    /**
     * 检查路径是否存在
     */
    public static void isPathExist() {
        File rootFile = new File(PATH_ROOT) ;
        if(!rootFile.exists()){
            rootFile.mkdirs() ;
        }
    }

    public static void isPathExist(String path) {
        File rootFile = new File(path);
        if(!rootFile.exists()){
            rootFile.mkdirs() ;
        }
    }

    public static void getVideoList() {
        isPathExist(VIDEO_PATH_ROOT);
        File rootFile = new File(VIDEO_PATH_ROOT);
        rootFile.listFiles();
    }

}
